home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr10 / tvprompt.zip / DOS_IO.LIB < prev    next >
Text File  |  1990-01-16  |  2KB  |  58 lines

  1. with System;
  2.  
  3. package Dos_IO is
  4.  
  5.   Mode_Error,
  6.   Name_Error,
  7.   Use_Error,
  8.   Status_Error,
  9.   Dos_Error: exception;
  10.  
  11.   type File_Handle is limited private;
  12.  
  13.   function Is_Open(Handle  : in     File_Handle) return Boolean;
  14.  
  15.   procedure Open(Name    : in     String;
  16.                  Handle  : in out File_Handle);
  17.  
  18.   type Byte_Counts is range 0 .. 65535;
  19.    for Byte_Counts'Size use 16;
  20.  
  21.   type Byte_Locations is range 0 .. 100_000_000; -- allow 100 Mb
  22.  
  23.   -- ask for N bytes, return nr actually read,0->EOF
  24.  
  25.   function Read(F       : in     File_Handle;
  26.                 Where   : in     System.Address;
  27.                 How_Many_Bytes: in Byte_Counts) return Byte_Counts;
  28.  
  29.   procedure Skip(F       : in     File_Handle;
  30.                  Bytes_To_Skip: in Byte_Counts);
  31.  
  32.   procedure Rewind(F       : in     File_Handle);
  33.  
  34.   procedure Move_To(F       : in     File_Handle;
  35.                     Where   : in Byte_Locations);
  36.  
  37.   procedure Create(Name    : in     String;
  38.                    Handle  : in out File_Handle);
  39.  
  40.   function Write(F       : in     File_Handle;
  41.                  Where   : in     System.Address;
  42.                  How_Many_Bytes: in Byte_Counts) return Byte_Counts;
  43.  
  44.   procedure Close(F       : in out File_Handle);
  45.  
  46.   function Current_Location(F : in File_Handle) return Byte_Locations;
  47.  
  48.   function Size_Of(F : in File_Handle) return Byte_Locations;
  49.  
  50. PRIVATE
  51.  
  52.   type File_Handle is record
  53.     Dos_File_Handle: System.Word;
  54.     Is_Open : Boolean := False;
  55.   end record;
  56.  
  57. end Dos_IO;
  58.